import request from '@/utils/request'

// 查询存储空间用户
export function getLibrsryUserList(query) {
  return request({
    url: `/netdisk/storage/config/user/list`,
    method: 'get',
    params: query
  })
}

// 查询存储空间学校
export function getLibrsrySchoolList(query) {
  return request({
    url: `/netdisk/storage/config/school/list`,
    method: 'get',
    params: query
  })
}

// 查询存储空间群组
export function getLibrsryGroupList(query) {
  return request({
    url: `/netdisk/storage/config/group/list`,
    method: 'get',
    params: query
  })
}

// 查询学校配置信息
export function getSchoolconfigInfo(query) {
  return request({
    url: `/netdisk/storage/config/school/configInfo`,
    method: 'get',
    params: query
  })
}

// 新增学校
export function addStorageConfig(data) {
  return request({
    url: `/netdisk/storage/config/school/addStorageConfig`,
    method: 'post',
    data
  })
}

// 编辑学校
export function editStorageConfig(data) {
  return request({
    url: `/netdisk/storage/config/school/editStorageConfig`,
    method: 'put',
    data
  })
}

// 存储空间启用停用
export function updatestoreStatus(data) {
  return request({
    url: `/netdisk/storage/config/school/updateStatus`,
    method: 'put',
    data
  })
}

// 批量新增用户
export function batchAddStorageConfig(data) {
  return request({
    url: `/netdisk/storage/config/user/batchAddStorageConfig`,
    method: 'post',
    data
  })
}

// 学校列表
export function getSchoolLisst(query) {
  return request({
    url: `/netdisk/common/schoolList`,
    method: 'get',
    params: query
  })
}

// 用户树
export function getuserTree(query) {
  return request({
    url: `/netdisk/common/userTree`,
    method: 'get',
    params: query
  })
}

// 删除群组前置校验
export function verifyGroupDelete(query) {
  return request({
    url: `/netdisk/storage/config/group/verifyDelete`,
    method: 'get',
    params: query
  })
}

// 批量删除群组配置
export function batchDeleteGroupStorage(data) {
  return request({
    url: `/netdisk/storage/config/group/batchDeleteStorageConfig`,
    method: 'delete',
    data
  })
}

// 删除用户前校验
export function verifyUserDelete(query) {
  return request({
    url: `/netdisk/storage/config/user/verifyDelete`,
    method: 'get',
    params: query
  })
}

// 批量删除用户配置
export function batchDeleteUserStorage(data) {
  return request({
    url: `/netdisk/storage/config/user/batchDeleteStorageConfig`,
    method: 'delete',
    data
  })
}

// 查询是否有群组容量不足
export function zeroStorage() {
  return request({
    url: `/netdisk/storage/config/group/zeroStorage`,
    method: 'get',
  })
}
